home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d27
/
autoc20b.arc
/
MENUCTL.DOC
< prev
next >
Wrap
Text File
|
1991-04-10
|
6KB
|
118 lines
MENU.CTL - Device Driver
Description:
Although Menu.Ctl was written to work directly with AutoCon, it is
a separate entity, and it can function indelpendently of AutoCon.
I will give enough information in this document to allow you to
use it independently, though I don't recommend doing so (sort of a
"Don't try this at home" warning).
Menu.Ctl works by taking over control of the processing of the
CONFIG.SYS file. It allows you to selectively disable various
groups of CONFIG.SYS commands. You tell Menu.Ctl which groups you
want to control by statements in the CONFIG.SYS file. The control
statements are defined below. The part of the control statements
enclosed in [] are optional sub controls.
I don't have DOS 4, but reports are that the device driver
XMAEM.SYS is processed out of normal sequence, therfore Menu.Ctl
can't control it. Only one control statement (DEVICE=XMAMEM.SYS)
relateing to XMAEM.SYS is allowed per CONFIG.SYS file. In other
words only put one statement in one default configuration. If
there are two XMAEM.SYS statements in the CONFIG.SYS file, I
assume that it will not work properly.
You should also note that any changes made during the boot process
have no effect on the actual contents of the CONFIG.SYS file.
When a device driver is activated the first time, DOS has not made
enough of itself functional to do "real" file activity. This
driver simply works on memory contents.
Disabling:
DOS 4.0 introduced a "REMARK" capability into CONFIG.SYS files.
Menu.Ctl uses this capability to disable the unwanted CONFIG.SYS
commands. It replaces all disabled commands with remark
statements. In DOSes before 4.0, there is no convenient remark
statement, so I had to find another way to disable commands.
While I was creating Menu.Ctl, I noticed that the "BREAK=OFF"
CONFIG.SYS command was processed with nothing visible on the
screen. So I adopted the technique of disabling commands by
replacing them with "BREAK=OFF" commands. This technique works
well, but there are two slight problems with it.
First, some of the commands I need to disable have a smaller
memory image than the "BREAK" command. I found that none of those
commands have a problem if you add something to the end of the
line to make it longer. Below is the way that I lengthen the
problem commands (I add an *, but any character should work):
LASTDRIVE=M: *
BUFFERS=10 *
FILES=40 *
Second, if you need to have "BREAK=ON" then you will have to put
the command in the AUTOEXEC.BAT fields. I don't know anyone who
uses this statement, but I'm sure someone does.
Unrecognized Commands:
If there is not enough room to convert a command to "BREAK=OFF"
then AutoCon will make it an "Unrecognized" command. There is no
problem with this technique, but it will lead to a lot of
"Unrecognized command in CONFIG.SYS" statements showing up on the
screen during the boot process.
CONTROL STATEMENTS
DEVICE=MENU.CTL [Mx Tx "Text]
This line gets inserted in the CONFIG.SYS file just ahead of the
first group of commands that you wish to be able to disable. The
x in [Tx] is the seconds MENU.CTL will pause waiting for a
keystroke before selecting the default configuration. x defaults
to zero. The x in [Mx] is the default menu number (1-8) that will
be selected as the default configuration. NOTE: AutoCon always
writes the CONFIG.SYS file so that the default is Menu 1, so you
will never see the [Mx] in a CONFIG.SYS file created by AutoCon.
The Text in ["Text] will be the first menu title shown. All text
following the " will be considered part of the title, so it must
be the last parameter on the line. You can specify the first
title this way, or by using the MTITLE command defined below.
AutoCon uses MTITLE for all Menu titles for my convenience.
DEVICE=MTITLE [Text]
The Text in [Text] will be shown as a Menu title on the screen
when you are making a configuration selection. Each MTITLE
command will create a new Menu selection (up to 8). The
CONFIG.SYS commands between MTITLE commands will become the
configuration choice after selection.
DEVICE=MENUEND
There is no way for a device driver to know where the end of the
CONFIG.SYS file is in memory, so this control statement lets
Menu.Ctl know where the end is. This statement must be in the
CONFIG.SYS file in order for it to work properly.
BATCH FILE PROCESSING (MENUNUM.COM)
MENUNUM.COM:
Menu.Ctl leaves about 180 bytes of itself in memory when it runs.
MENUNUM.COM is able to communicate with this resident portion. It
uses the information in Menu.Ctl to set the errorlevel to the menu
number chosen during the boot process. If Menu.Ctl can't be
found, the errorlevel will be set to 0. If all menu choices were
disabled (Menu.Ctl allows the disabling of all CONFIG.SYS
commands), the MENUNUM will set the errorlevel to 255 (FF hex).
If you look at the Autoexec.Bat file created by AutoCon in the
Menu mode, the first thing you will see is MENUNUM.COM. Following
this you will see several "IF ERRORLEVEL" statements. These if
statements allow the CONFIG.SYS menu choice to be related to the
AUTOEXEC.BAT menu choices.
Thus all you need to write your own Boot Menu is Menu.Ctl and
MenuNum.Com. A little study of the CONFIG.SYS and AUTOEXEC.BAT
menu mode files written by AutoCon will give you all of the
examples you need.